<template>
    <view class="page" :style="themeColor">
    <view class="flex flex-direction flex-wrap align-stretch benben-position-layout flex applyAfterSales_flex_0"    :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx'}">
            <view   class='flex flex-wrap align-center justify-between applyAfterSales_fd0_0'     >
            <view   class='flex flex-wrap align-center applyAfterSales_fd0_0_c0'  @tap.stop="handleJumpDiy" data-type="back" data-url="1"   >
        <text class='fu-iconfont2  applyAfterSales_fd0_0_c0_c0' >&#xE794;</text>
</view>
    <view   class='flex flex-wrap align-center'     >
        <text class='applyAfterSales_fd0_0_c1_c0' >申请售后</text>
</view>
    <view   class='flex align-center justify-end applyAfterSales_fd0_0_c2'     >
        </view>
</view>

        </view>
<view :style="{height: (88+StatusBarRpx)+'rpx'}"  ></view>
<!---售后订单flex布局开始-->
 <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout applyAfterSales_flex_1"   >
            <view   class='flex flex-direction flex-wrap align-stretch applyAfterSales_fd1_0'     >
            <view   class='flex flex-wrap align-stretch'     >
        <image class='applyAfterSales_fd1_0_c0_c0' mode="aspectFit"  :src='dataDetails.goods_thumb'></image>
    <view   class='flex flex-direction flex-wrap align-stretch flex-sub applyAfterSales_fd1_0_c0_c1'     >
        <text class='applyAfterSales_fd1_0_c0_c1_c0' >{{dataDetails.goods_name}}</text>
<text class='applyAfterSales_fd1_0_c0_c1_c1' >{{dataDetails.sku_name}}</text>
    <view   class='flex flex-wrap align-center justify-between'     >
            <view   class='flex flex-wrap align-center'     >
        <text class='applyAfterSales_fd1_0_c0_c1_c2_c0_c0' >￥</text>
<view class=' applyAfterSales_fd1_0_c0_c1_c2_c0_c1'  >
    <text class=' applyAfterSales_price1_fd1_0_c0_c1_c2_c0_c1'>{{ dataDetails.shop_price | frontPrice }}</text>
    <text class=' applyAfterSales_price2_fd1_0_c0_c1_c2_c0_c1'>{{ dataDetails.shop_price | laterPrice }}</text>
</view>
</view>
    <view   class='flex flex-wrap align-center applyAfterSales_fd1_0_c0_c1_c2_c1'     >
        <text  >x</text>
<text  >{{dataDetails.num}}</text>
</view>
</view>
</view>
</view>
    <view   class='flex flex-direction flex-wrap align-stretch'     >
            <view   class='flex flex-wrap align-center applyAfterSales_fd1_0_c1_c0'  @tap.stop="pickerDiy1657249350798=true"   >
        <text class='applyAfterSales_fd1_0_c1_c0_c0' >售后选择</text>
<input class='flex-sub applyAfterSales_fd1_0_c1_c0_c1'  type="text" placeholder="请选择售后类型" confirm-type="done" :maxlength="-1" :disabled='true' placeholder-style="color:rgba(191, 191, 191, 1);font-size:32rpx"  v-model="refund_name" />
<text class='fu-iconfont2  applyAfterSales_fd1_0_c1_c0_c2' >&#xe7f2;</text>
</view>
    <view   class='flex flex-wrap align-center applyAfterSales_fd1_0_c1_c1'  @tap.stop="pickerDiy1657249316216=true"   >
        <text class='applyAfterSales_fd1_0_c1_c1_c0' >退货/退款原因</text>
<input class='flex-sub applyAfterSales_fd1_0_c1_c1_c1'  type="text" placeholder="请选择退款原因" confirm-type="done" :maxlength="-1" :disabled='true' placeholder-style="color:#BFBFBF;font-size:32rpx"  v-model="cancel_name" />
<text class='fu-iconfont2  applyAfterSales_fd1_0_c1_c1_c2' >&#xe7f2;</text>
</view>
    <view   class='flex flex-wrap align-center justify-end applyAfterSales_fd1_0_c1_c2'     >
        <text class='applyAfterSales_fd1_0_c1_c2_c0' >退款金额：</text>
<text class='applyAfterSales_fd1_0_c1_c2_c1' >￥</text>
<view class=' applyAfterSales_fd1_0_c1_c2_c2'  >
    <text class=' applyAfterSales_price1_fd1_0_c1_c2_c2'>{{ dataDetails.refund_money | frontPrice }}</text>
    <text class=' applyAfterSales_price2_fd1_0_c1_c2_c2'>{{ dataDetails.refund_money | laterPrice }}</text>
</view>
</view>
    <view   class='flex flex-wrap align-center applyAfterSales_fd1_0_c1_c3'     >
        <text  >含发货运费</text>
<text  >0</text>
<text  >元，不可修改</text>
</view>
</view>
    <view   class='flex flex-direction flex-wrap align-stretch applyAfterSales_fd1_0_c2'     >
        <text class='applyAfterSales_fd1_0_c2_c0' >退款说明</text>
<view class='flex flex-wrap applyAfterSales_fd1_0_c2_c1'>
<textarea class='flex applyAfterSales_input_fd1_0_c2_c1' confirm-type="done" :placeholder="'请在此描述申请售后服务的原因'" :maxlength="200" :show-num='true' placeholder-style="color:#999;font-size:28rpx"   v-model="refund_content" />
<template>    <view   class='flex flex justify-end applyAfterSales_numberfd1_0_c2_c1_c0'     >
        <text  >{{refund_content.length}}</text>
<text  >/</text>
<text  >200</text>
</view>
</template>
</view>
</view>
    <view   class='flex flex-wrap align-center applyAfterSales_fd1_0_c3'     >
            <benben-images-upload  ref="benbenImagesUploadfd1_0_c3_c0"  :img-list.sync="imgs" :img-ids.sync="refund_picture" :maxlength="9" >
    <template #content="{ num, maxlength, isShow, imgList }">
     <view class="flex flex-wrap align-start flex applyAfterSales_fd1_0_c3_c0">
            
    <view v-for="(image, index) in imgList" :key="index"  class='flex position-relative applyAfterSales_fd1_0_c3_c00'     >
        <text class='fu-iconfont2 position-absolute applyAfterSales_fd1_0_c3_c000'  @tap.stop="$refs.benbenImagesUploadfd1_0_c3_c0.delImage(index)">&#xE8E7;</text><image class='applyAfterSales_fd1_0_c3_c001' @tap.stop="$refs.benbenImagesUploadfd1_0_c3_c0.previewImage(index)"  :src='image'></image>
    </view>
    
            <image class='applyAfterSales_fd1_0_c3_c01' @tap.stop="$refs.benbenImagesUploadfd1_0_c3_c0.manyChooseImage()"  v-if="isShow" mode="aspectFit"  :src='STATIC_URL+"49.jpg"'></image>
            
          </view>
        </template>
    </benben-images-upload>
</view>
</view>
</view>
<!---售后订单flex布局结束-->
<!--退款原因开始 -->
        <benben-picker ref="benbenWritePickerCodepicker2" :visible.sync="pickerDiy1657249316216" :label.sync='cancel_name' :value.sync='cancel_id' :options='cancel_reason'  mode='selector' :mask-show='true' :timeout='true' :picker-height='88' default-type='aid' :default-props='{"label":"reason","value":"aid"}' >
            <template #picker-header>
        <view   class='flex flex-wrap align-center justify-between applyAfterSales_picker2_0'     >
        <text class='applyAfterSales_picker2_0_c0' @tap="$refs.benbenWritePickerCodepicker2.cancel()" >取消</text>
<text class='applyAfterSales_picker2_0_c1' >退款原因</text>
<text class='applyAfterSales_picker2_0_c2' @tap="$refs.benbenWritePickerCodepicker2.pickerConfirm()" >确定</text>
</view>
</template>
        </benben-picker>
<!--退款原因结束 -->
<!--售后类型开始 -->
        <benben-picker ref="benbenWritePickerCodepicker3" :visible.sync="pickerDiy1657249350798" :label.sync='refund_name' :value.sync='refund_id' :options='refund_type'  mode='selector' :mask-show='true' :timeout='true' :picker-height='88' default-type='value' :default-props='{"label":"name","value":"value"}' >
            <template #picker-header>
        <view   class='flex flex-wrap align-center justify-between applyAfterSales_picker3_0'     >
        <text class='applyAfterSales_picker3_0_c0' @tap="$refs.benbenWritePickerCodepicker3.cancel()" >取消</text>
<text class='applyAfterSales_picker3_0_c1' >售后类型</text>
<text class='applyAfterSales_picker3_0_c2' @tap="$refs.benbenWritePickerCodepicker3.pickerConfirm()" >确定</text>
</view>
</template>
        </benben-picker>
<!--售后类型结束 -->
    <view class="flex flex-direction flex-wrap align-center benben-position-layout flex applyAfterSales_flex_4"    >
        <button class='applyAfterSales_fd4_0' @tap.stop="sumbitFunc()"  >提交</button>

        </view>
<view :style="{height: '120rpx'}"  ></view>
    
    
    </view>
</template>
<script>
    import {validate} from '@/common/utils/validate.js'
    export default {
        components:{},
        
        
        data(){
			return {"pickerDiy1657249350798":false,"pickerDiy1657249316216":false,"refund_type":[{"name":"退款","value":"1","image":""},{"name":"退款/退货","value":"2","image":""}],"refund_name":"","cancel_reason":[],"cancel_name":"","cancel_id":"","dataDetails":{"order_sn":"","goods_id":"","sku_id":"","goods_name":"","goods_thumb":"","sku_name":"","shop_price":"","num":"","order_status":"","refund_type":"","refund_money":"","refund_reason":{}},"refund_id":"","refund_picture":"","refund_content":"","imgs":[],"order_sn":"","goods_id":"","sku_id":"","num":""};
		},
		computed:{
            themeColor() {
              return this.$store.getters.themeColor
            },
            
		},
		watch:{},
		onLoad(options){
            let {order_sn,goods_id,sku_id,num}=options
if (order_sn !== undefined) this.order_sn = order_sn
if (goods_id !== undefined) this.goods_id = goods_id
if (sku_id !== undefined) this.sku_id = sku_id
if (num !== undefined) this.num = num
this.DataDetailsFunc()
		},
        onUnload() {
                
        },
		onReady(){
            
		},
		onShow(){
            
		},
		onHide(){
            
		},
		onResize(){
            
		},
		onPullDownRefresh(){
            
		},
		onReachBottom(e){
            
		},
		onPageScroll(e){
            
		},
		methods:{
                            //获取订单详情
                async DataDetailsFunc(){
                        //请求方法
    //数据验证
    
  let datadataDetails = await this.$api.post(global.apiUrls.post6112139286f7b, {
    order_sn:this.order_sn,goods_id:this.goods_id,sku_id:this.sku_id,num:this.num
  });
  if (datadataDetails.data.code != 1) {
    this.$message.info(datadataDetails.data.msg);
    return
  } 
  let infodataDetails = datadataDetails.data;
  this.dataDetails = infodataDetails.data
    //请求方法
    //数据验证
    
  let datacancel_reason = await this.$api.get(global.apiUrls.post62ce204adcffb, {
    type:this.dataDetails.refund_type,list_rows:'15'
  });
  if (datacancel_reason.data.code != 1) {
    this.$message.info(datacancel_reason.data.msg);
    return
  } 
  let infocancel_reason = datacancel_reason.data;
  this.cancel_reason = infocancel_reason.data
    if(this.dataDetails.refund_type=='1'){
           this.refund_name = '退款';
   this.refund_id = '1';
    }
    if(this.dataDetails.refund_type=='2'){
           this.refund_name = '退款/退货';
   this.refund_id = '2';
    }
                },
                //提交
                async sumbitFunc(){
                                if(!validate(this.refund_id,'require')){
                 this.$message.info('请选择退款类型');
                 return false;
            }
            if(!validate(this.cancel_id,'require')){
                 this.$message.info('请选择退款原因');
                 return false;
            }
            if(!validate(this.refund_content,'require')){
                 this.$message.info('请输入退款内容');
                 return false;
            }
            if(!validate(this.refund_picture,'require')){
                 this.$message.info('请上传退款图片');
                 return false;
            }
    //请求方法
    //数据验证
    
  let data62c6b9642d3f9 = await this.$api.get(global.apiUrls.post62c6b9642d3f9, {
    order_sn:this.order_sn,refund_type:this.refund_id,refund_reason:this.cancel_name,goods_id:this.goods_id,sku_id:this.sku_id,num:this.num,refund_picture:this.refund_picture,refund_content:this.refund_content,refund_money:this.dataDetails.refund_money
  });
  if (data62c6b9642d3f9.data.code != 1) {
    this.$message.info(data62c6b9642d3f9.data.msg);
    return
  } 
  
  
                    this.$message.info('提交成功');
                setTimeout(()=>{
                    uni.navigateBack({
              delta:1
            });
      },500)
                }
		}
    };
</script> 
<style lang="scss" scoped>
           .page{
            width: 100vw;
            overflow-x: hidden;
            min-height: calc(100vh - var(--window-bottom));
            background:rgba(246, 246, 246, 1);background-size: 100% auto !important;
        }
    .applyAfterSales_flex_0{
        background:#fff;width:750rpx;height:88rpx;overflow:hidden;z-index:10;top:0rpx;background-size:100% auto !important;
    }
    .applyAfterSales_fd0_0_c2{
        padding:0rpx 0rpx 0rpx 0rpx;width:200rpx;
    }
    .applyAfterSales_fd0_0_c1_c0{
        font-size:36rpx;font-weight:500;color:#333333;
    }
    .applyAfterSales_fd0_0_c0_c0{
        font-size:36rpx;color:#333;font-weight:500;
    }
    .applyAfterSales_fd0_0_c0{
        width:200rpx;
    }
    .applyAfterSales_fd0_0{
        padding:0rpx 32rpx 0rpx 32rpx;line-height:88rpx;
    }
    .applyAfterSales_flex_1{
        border-bottom:10px solid #F8F8F8;padding:24rpx 24rpx 0rpx 24rpx;
    }
    .applyAfterSales_fd1_0_c3_c01{
        width:160rpx;height:160rpx;margin:0rpx 24rpx 24rpx 0rpx;
    }
    .applyAfterSales_fd1_0_c3_c001{
        width:160rpx;height:160rpx;
    }
    .applyAfterSales_fd1_0_c3_c000{
        top:0rpx;right:0rpx;z-index:10;color:#ff5536;
    }
    .applyAfterSales_fd1_0_c3_c00{
        margin:0rpx 24rpx 24rpx 0rpx;
    }
    .applyAfterSales_fd1_0_c3_c0{
        width:100%;padding:24rpx 0rpx 0rpx 0rpx;
    }
    .applyAfterSales_fd1_0_c3{
        padding:0rpx 0rpx 0rpx 0rpx;
    }
    .applyAfterSales_numberfd1_0_c2_c1_c0{
        font-size:24rpx;color:#BFBFBF;font-weight:400;width:100%;
    }
    .applyAfterSales_input_fd1_0_c2_c1{
        font-size:28rpx;font-weight:400;color:#333;width:100%;height:200rpx;
    }
    .applyAfterSales_fd1_0_c2_c1{
        background:rgba(248, 248, 248, 1);border-radius:16rpx 16rpx 16rpx 16rpx;padding:24rpx 24rpx 24rpx 24rpx;font-size:28rpx;font-weight:500;height:272rpx;
    }
    .applyAfterSales_fd1_0_c2_c0{
        font-size:32rpx;font-weight:400;color:#111111;margin:0rpx 0rpx 20rpx 0rpx;
    }
    .applyAfterSales_fd1_0_c2{
        margin:32rpx 0rpx 0rpx 0rpx;
    }
    .applyAfterSales_fd1_0_c1_c3{
        font-size:28rpx;line-height:28rpx;font-weight:400;color:var(--benbenFontColor2);
    }
    .applyAfterSales_price2_fd1_0_c1_c2_c2{
        font-size:22rpx;
    }
    .applyAfterSales_price1_fd1_0_c1_c2_c2{
        font-size:32rpx;line-height:36rpx;font-weight:700;color:#FF4133;
    }
    .applyAfterSales_fd1_0_c1_c2_c2{
        color:#ff5536;font-weight:600;
    }
    .applyAfterSales_fd1_0_c1_c2_c1{
        font-size:22rpx;font-weight:700;color:#FF4133;
    }
    .applyAfterSales_fd1_0_c1_c2_c0{
        margin:0rpx auto 0rpx 0rpx;font-size:32rpx;font-weight:400;color:#111111;
    }
    .applyAfterSales_fd1_0_c1_c2{
        margin:32rpx 0rpx 8rpx 0rpx;
    }
    .applyAfterSales_fd1_0_c1_c1_c2{
        color:rgba(112, 112, 112, 1);font-weight:500;font-size:16rpx;margin:0rpx 0rpx 0rpx 20rpx;
    }
    .applyAfterSales_fd1_0_c1_c1_c1{
        font-size:32rpx;font-weight:500;color:#333;height:70rpx;text-align:right;
    }
    .applyAfterSales_fd1_0_c1_c1_c0{
        font-size:32rpx;font-weight:400;color:#111111;
    }
    .applyAfterSales_fd1_0_c1_c1{
        padding:20rpx 0rpx 0rpx 0rpx;
    }
    .applyAfterSales_fd1_0_c1_c0_c2{
        color:rgba(112, 112, 112, 1);font-weight:500;font-size:16rpx;margin:0rpx 0rpx 0rpx 20rpx;
    }
    .applyAfterSales_fd1_0_c1_c0_c1{
        font-size:32rpx;font-weight:500;color:#333;height:70rpx;text-align:right;
    }
    .applyAfterSales_fd1_0_c1_c0_c0{
        font-size:32rpx;font-weight:400;color:#111111;
    }
    .applyAfterSales_fd1_0_c1_c0{
        padding:20rpx 0rpx 0rpx 0rpx;margin:0rpx 0rpx 10rpx 0rpx;
    }
    .applyAfterSales_fd1_0_c0_c1_c2_c1{
        font-size:24rpx;font-weight:400;color:#999999;
    }
    .applyAfterSales_price2_fd1_0_c0_c1_c2_c0_c1{
        font-size:22rpx;
    }
    .applyAfterSales_price1_fd1_0_c0_c1_c2_c0_c1{
        font-size:32rpx;
    }
    .applyAfterSales_fd1_0_c0_c1_c2_c0_c1{
        color:#ff5536;font-weight:600;
    }
    .applyAfterSales_fd1_0_c0_c1_c2_c0_c0{
        font-size:20rpx;font-weight:700;color:#FF4133;
    }
    .applyAfterSales_fd1_0_c0_c1_c1{
        font-size:24rpx;font-weight:400;color:#999999;margin:10rpx 0rpx 36rpx 0rpx;-webkit-line-clamp:1;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;
    }
    .applyAfterSales_fd1_0_c0_c1_c0{
        font-size:28rpx;font-weight:500;color:#333333;-webkit-line-clamp:2;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;
    }
    .applyAfterSales_fd1_0_c0_c1{
        margin:0rpx 0rpx 0rpx 34rpx;
    }
    .applyAfterSales_fd1_0_c0_c0{
        width:200rpx;height:200rpx;border-radius:0rpx 0rpx 0rpx 0rpx;
    }
    .applyAfterSales_fd1_0{
        background:#fff;border-radius:16rpx 16rpx 16rpx 16rpx;padding:24rpx 24rpx 8rpx 24rpx;background-size:100% auto !important;margin:0rpx 0rpx 12rpx 0rpx;
    }
    .applyAfterSales_picker2_0_c2{
        color:var(--benbenFontColor0);font-size:28rpx;font-weight:700;
    }
    .applyAfterSales_picker2_0_c1{
        font-size:36rpx;font-weight:700;color:#333333;
    }
    .applyAfterSales_picker2_0_c0{
        font-size:28rpx;font-weight:400;color:#999999;line-height:0rpx;
    }
    .applyAfterSales_picker2_0{
        border-bottom:1px solid #eee;background:#fff;padding:0rpx 32rpx 0rpx 32rpx;line-height:114rpx;border-radius:25rpx 25rpx 0rpx 0rpx;background-size:100% auto !important;
    }
    .applyAfterSales_picker3_0_c2{
        color:var(--benbenFontColor0);font-size:28rpx;font-weight:700;
    }
    .applyAfterSales_picker3_0_c1{
        line-height:0rpx;font-size:36rpx;font-weight:700;color:#333333;
    }
    .applyAfterSales_picker3_0_c0{
        line-height:0rpx;font-size:28rpx;font-weight:400;color:#999999;
    }
    .applyAfterSales_picker3_0{
        border-bottom:1px solid #eee;background:#fff;padding:0rpx 32rpx 0rpx 32rpx;line-height:114rpx;border-radius:25rpx 25rpx 0rpx 0rpx;background-size:100% auto !important;
    }
    .applyAfterSales_flex_4{
        width:750rpx;height:120rpx;overflow:hidden;z-index:10;bottom:calc(0rpx + var(--window-bottom));
    }
    .applyAfterSales_fd4_0{
        background:var(--benbenbgColor0);font-size:32rpx;color:#fff;width:686rpx;height:88rpx;line-height:88rpx;font-weight:700;border-radius:100rpx 100rpx 100rpx 100rpx;
    }
</style>